#pragma once
#include <list>
#include <vector>
#include <Windows.h>
#include <fstream>
#include <stdio.h>
#include <iostream>
#include <MMSystem.h>
#include <string>
#include <cmath>

using namespace std;

class graphClass
{
private:
    int period;
    vector<double> values;
    ifstream input;
    MMRESULT timer;
    COLORREF color;
    bool valid;
    bool started;
    wstring filePath;  
    HWND hWnd;
	HWND hCtrl;		//!//?
    double yScale;
    int yOffset;
    double maxValue;
    double minValue;
    bool visible;
	wstring graphName;
public:
    graphClass(const graphClass &copy);
    graphClass(const wstring filePathIN, COLORREF colorIN, HWND hWndIN);    
    ~graphClass();
    void start();
    void stop();
    int getPeriod(); 
	void loadValue();
	void sendMes();
	int getLength();
	void setYScale(double);
	void setYOffset(int);
	double getYScale();
	int getYOffset();
	double getValue(int i);
	void show();
	void hide();
	bool isVisible();
	bool isStarted();
	COLORREF getColor();
	void setColor(COLORREF);
	HWND getHCtrl();
	void setHCtrl(HWND hWnd);	
	wstring getGraphName(); 
	void setGraphName(wstring graphNameIN);
	wstring getFilePath();
	double getMaxValue();
	double getMinValue();
};

void CALLBACK timerProc(UINT wTimerID, UINT msg, DWORD dwUser, DWORD dw1, DWORD dw2);
